package com.ytrsoft.entity;

import com.ytrsoft.enums.RelationshipStatus;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.*;

@Schema(description = "关系类")
@Entity
public class Relationship extends BaseEntity {

    @Schema(description = "确认方")
    @ManyToOne
    @JoinColumn(name = "user_from_id", nullable = false)
    private User userFrom;

    @Schema(description = "被确认方")
    @ManyToOne
    @JoinColumn(name = "user_to_id", nullable = false)
    private User userTo;

    @Schema(description = "状态")
    @Enumerated(EnumType.STRING)
    private RelationshipStatus status;

    @Schema(description = "距离")
    private Double distance;

    public User getUserFrom() {
        return userFrom;
    }

    public void setUserFrom(User userFrom) {
        this.userFrom = userFrom;
    }

    public User getUserTo() {
        return userTo;
    }

    public void setUserTo(User userTo) {
        this.userTo = userTo;
    }

    public RelationshipStatus getStatus() {
        return status;
    }

    public void setStatus(RelationshipStatus status) {
        this.status = status;
    }

    public Double getDistance() {
        return distance;
    }

    public void setDistance(Double distance) {
        this.distance = distance;
    }
}
